<%@ page contentType="text/html;charset=UTF-8"%>
<%
    HttpSession s = request.getSession();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="${appServer }/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${appServer }/assets/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="${appServer }/assets/css/font-awesome.css" rel="stylesheet">
    <link href="${appServer }/assets/css/animate.css" rel="stylesheet">
    <link href="${appServer }/assets/css/style.css" rel="stylesheet">
    <link href="${appServer }/assets/css/login.css" rel="stylesheet">
	<style>
        .error {
            color: red;
            border-color:red;
        }

        .valid {
            color: black;
        }
    </style>
</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-12">
                <form method="post" role="form" action="${appServer}/login.htm" id="loginForm">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到订单管理平台</p>
                    <input type="text" class="form-control uname" placeholder="用户名" id="memberName" name="memberName" data-placement="top" title="请填写用户名" />
                    <input type="password" class="form-control pword m-b" placeholder="密码" id="memberPwd" name="memberPwd" data-placement="top" title="请填写密码"/>
                    <span>忘记密码了？请联系管理员</span>
                    <button class="btn btn-success btn-block" id="loginBtn">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 
            </div>
        </div>
    </div>
    
    <script src="${appServer }/assets/js/jquery-1.12.4.js"></script>
    <script src="${appServer }/assets/js/bootstrap.min.js"></script>
    <script src="${appServer }/assets/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="${appServer }/assets/js/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript">
     var loginMsg = "${loginMsg}";
     $(function () {
        $("#loginForm").validate({
            rules: {
                memberName: {
                    required: true
                },
                memberPwd: 'required'
            },
            messages: {
            	memberName: {
                    required: "请填写用户名",
                },
                memberPwd: "请填写密码"
            },
            errorClass: "error",
            success: 'valid',
            unhighlight: function (element, errorClass, validClass) { //验证通过
                $(element).tooltip('destroy').removeClass(errorClass);
            },
            
            errorPlacement: function (input, element) {
                $(element).tooltip('destroy'); /*必需*/
                $(element).attr('title', $(input).text()).tooltip('show'); 
            },
            submitHandler: function (form) {
            	form.submit();
            }
        })
     });
     if (loginMsg != null && loginMsg != "") {
    	 swal("登录失败！", loginMsg, "error");
     }
    </script>
</body>
</html>